﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Linq;
using System.ServiceProcess;


namespace SSATool.DL.Server.WindowsService
{
    [RunInstaller(true)]
    public partial class SSAToolServiceInstaller : System.Configuration.Install.Installer
    {
        public SSAToolServiceInstaller()
        {
            InitializeComponent();
        }

        protected override void OnAfterInstall(IDictionary savedState)
        {
            base.OnAfterInstall(savedState);
            
            using (ServiceController controller = new ServiceController(ServiceInstaller.ServiceName))
            {
                controller.Start();
            }
        }
    }
}
